Skip to content

Add The Arena: Community discussion platform with Supabase auth#3

Open
davidddeveloper wants to merge 17 commits intomasterfrom
claude/community-chat-feature-vPDIB
Open

Add The Arena: Community discussion platform with Supabase auth#3
davidddeveloper wants to merge 17 commits intomasterfrom
claude/community-chat-feature-vPDIB

Conversation

@davidddeveloper
Copy link
Contributor

Summary

Introduces "The Arena," a community discussion platform where users can share ideas, projects, stories, and opportunities. This feature includes user authentication via Supabase (magic links, Google, GitHub OAuth), post creation with rich text editing, categorization, tagging, and a discussion/comments system.

Key Changes

Authentication & User Management

  • Added Supabase authentication setup with magic link and OAuth (Google, GitHub) support
  • Created AuthProvider context for managing user sessions across the app
  • Implemented auth callback route for handling OAuth redirects
  • Added environment configuration template (.env.local.example)

Core Features

  • Post Creation: Full-featured post editor with rich text support, category selection, and tagging
  • Post Discovery: Browse posts by category (Building, Ideas, Stories, Opportunities, Challenges) with filtering
  • Post Details: Individual post pages with view tracking, reactions system, and discussion threads
  • Comments: Nested discussion system allowing authenticated users to comment on posts
  • User Profiles: Profile pages for community members (referenced but component not shown in diff)

UI/UX Components

  • Consistent design system using Tenacity's color palette (#37322f, #f7f5f3, etc.)
  • Responsive layouts with mobile-first approach
  • Smooth animations using Framer Motion
  • Category-based visual styling with icons and color coding
  • Empty states and loading skeletons for better UX

Database Integration

  • Supabase queries for posts, comments, and user profiles
  • Automatic slug generation for posts
  • View count tracking
  • Excerpt auto-generation from rich text content

Notable Implementation Details

  • Magic link authentication redirects to /arena/auth/callback for session exchange
  • Posts support rich text content stored as JSON for flexible rendering
  • Comments are ordered chronologically and linked to both posts and authors
  • Reaction system prepared with fire, lightbulb, launch, tenacity, and respect emoji reactions
  • Time-relative formatting using date-fns for post/comment timestamps
  • Protected routes redirect unauthenticated users to login page

https://claude.ai/code/session_01Ga6n9rgaGbtbcu7bq5imyi

Implements a full-featured community platform with:
- Supabase integration for database and auth
- Magic link and OAuth (Google, GitHub) authentication
- Rich text editor with Tiptap for creating posts
- Post categories: Building, Ideas, Stories, Opportunities, Challenges
- Threaded comments on posts
- User profiles with bio, skills, and role
- Settings page for profile management
- Responsive design maintaining Tenacity aesthetic

New pages:
- /arena - Main community feed
- /arena/login - Authentication page
- /arena/new - Create new post
- /arena/post/[slug] - Single post view
- /arena/profile/[username] - User profile
- /arena/settings - Profile settings

Database schema included in supabase/migrations/

https://claude.ai/code/session_01Ga6n9rgaGbtbcu7bq5imyi
@vercel
Copy link

vercel bot commented Jan 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
community Ready Ready Preview, Comment Jan 31, 2026 8:28pm

Fixes the Vercel deployment error "useSearchParams() should be wrapped
in a suspense boundary". Extracted the client component that uses
useSearchParams into a separate ArenaContent component and wrapped it
with React Suspense in the page component.

https://claude.ai/code/session_01Ga6n9rgaGbtbcu7bq5imyi
…ages

- Make Supabase browser client a singleton to prevent AbortError from
  multiple auth listeners being created
- Show actual error message when post publishing fails

https://claude.ai/code/session_01Ga6n9rgaGbtbcu7bq5imyi
The auth callback was creating cookies via cookies().set() but then
returning a new NextResponse.redirect() that didn't include them.
Now cookies are set directly on the response object that gets returned.

https://claude.ai/code/session_01Ga6n9rgaGbtbcu7bq5imyi
Major improvements to The Arena:

- Fix session state not updating after OAuth redirect by using getUser()
  for server-verified sessions, handling INITIAL_SESSION event, and
  adding visibility/focus listeners
- Add loading states to OAuth buttons on login page
- Implement working reactions feature with optimistic updates
- Add delete post functionality with confirmation modal
- Add edit post page at /arena/edit/[slug]
- Fix RichTextEditor to properly parse JSON content for editing
- Add copy-to-clipboard feedback on share button

https://claude.ai/code/session_01Ga6n9rgaGbtbcu7bq5imyi
- Add generateMetadata utility for consistent SEO across pages
- Add post layout with dynamic metadata generation for individual posts
- Improve arena layout with cleaner styling
- Enhance arena-content with better spacing and structure
- Add additional types to supabase types
- Include Open Graph and Twitter card support for social sharing

https://claude.ai/code/session_01Ga6n9rgaGbtbcu7bq5imyi
- Redesign comment threads with minimal, slick UI
  - Hover-to-reveal actions (reply, edit, delete)
  - Smooth animations and transitions
  - Better visual hierarchy with nested replies
- Add proper pagination for comments (5 per page)
- Create dedicated bookmarks page at /arena/bookmarks
  - View all saved posts with pagination
  - Quick remove bookmark on hover
  - Empty state with call to action
- Improve sign-out experience
  - Add confirmation modal before signing out
  - Loading state during sign-out process
  - Smooth transitions and backdrop blur
- Add bookmarks link to user dropdown menu

https://claude.ai/code/session_01Ga6n9rgaGbtbcu7bq5imyi
- Rewrite auth-context with proper race condition handling
  - Use ref to prevent duplicate profile fetches
  - Skip INITIAL_SESSION event (handled manually)
  - Add debounced session check on focus/visibility
  - Auto-create profile if not exists
- Improve auth callback route
  - Better error handling with specific error messages
  - Auto-create profile after OAuth login
  - Proper cookie options (path, sameSite, secure, httpOnly)
- Update middleware for protected routes
  - Redirect to login with 'next' param for protected pages
  - Use getUser() instead of getSession() for verification
- Update browser client with explicit auth options
  - persistSession, autoRefreshToken, detectSessionInUrl
- Add server helpers for getting user/profile in SSR

https://claude.ai/code/session_01Ga6n9rgaGbtbcu7bq5imyi
- Remove singleton pattern from browser client
  - Create fresh client each time to ensure cookies are read
- Skip middleware for /arena/auth/* routes
  - Let auth callback handle cookies without interference
- Simplify auth context
  - Remove complex race condition handling
  - Let onAuthStateChange handle session updates naturally
- Remove route protection from middleware
  - Let client-side handle redirects (already implemented in pages)
- Let Supabase handle cookie options in callback
  - Don't override cookie settings that might conflict

https://claude.ai/code/session_01Ga6n9rgaGbtbcu7bq5imyi
- Remove category links from header (keep only in sidebar)
- Add notifications bell icon placeholder
- Add "Your Posts" link to dropdown menu
- Make header more compact with backdrop blur
- Cleaner navigation: Logo | The Arena | [Bell] [New Post] [Avatar]

https://claude.ai/code/session_01Ga6n9rgaGbtbcu7bq5imyi
- Add reading time estimate next to post date
  - Calculates based on ~200 words per minute
- Add social share menu with Twitter/LinkedIn options
  - Share to X (Twitter) with post title and author
  - Share to LinkedIn with post URL
  - Copy link fallback
- Add floating back to top button
  - Appears after scrolling 400px
  - Smooth scroll animation

https://claude.ai/code/session_01Ga6n9rgaGbtbcu7bq5imyi
- Create ThemeProvider context with light/dark/system options
- Add dark mode CSS variables for arena colors
- Add theme toggle button in header (sun/moon icons)
- Persist theme preference in localStorage
- Support system preference detection

https://claude.ai/code/session_01Ga6n9rgaGbtbcu7bq5imyi
…s, infinite scroll

- Add follow/unfollow functionality on user profiles with follower/following counts
- Implement notifications system with dropdown in header and dedicated page
- Create notifications for follows, reactions, comments, replies, and mentions
- Add @mentions in comments with autocomplete suggestions
- Render mentions as clickable links to user profiles
- Add infinite scroll toggle with localStorage persistence
- Real-time notification updates via Supabase subscriptions

https://claude.ai/code/session_01Ga6n9rgaGbtbcu7bq5imyi
- Fix notifications 400 error by simplifying query (avoid foreign key hints)
- Update theme context to handle hydration properly
- Use CSS variables throughout Arena for dark mode support
- Add horizontal scrollable categories on mobile
- Fix notification dropdown hover contrast
- Add scrollbar-hide utility class

https://claude.ai/code/session_01Ga6n9rgaGbtbcu7bq5imyi
…ality

- Theme toggle now visible even when user isn't logged in
- Centered "The Arena" text in navigation using absolute positioning
- Fixed "mark all as read" button with proper event handling and loading state
- Updated PostCard to use CSS variables for full dark mode support
- Added dark mode variants for category badges
- Moved hero section inside main content area for proper alignment with posts

https://claude.ai/code/session_01Ga6n9rgaGbtbcu7bq5imyi
- Updated all arena pages to use CSS variables for dark mode support:
  - bookmarks, login, new, notifications, profile, settings pages
- Centered sidebar categories vertically on desktop for better visual balance
- Fixed mobile nav overlap by hiding "The Arena" text on small screens
- Replaced all hardcoded colors (#f7f5f3, #37322f, etc.) with CSS variables
- Added responsive grid (2 cols mobile, 4 cols desktop) for profile stats

https://claude.ai/code/session_01Ga6n9rgaGbtbcu7bq5imyi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants